<style>
.pa5h4{
	margin-bottom:0px
}
</style>
	<div id="doc">
		<div class="page4" style="position: fixed;top: 0%;z-index: 4;background-color: #ffffff;width:100%;height:100%;overflow:auto;max-width:640px" id="page4" >
			<div class="main6">
				<foreach name="mp3_list" item="value">
					<div class="txt1pa2">
						<div class="pa5anr"><small  class="smallone"><{:date("Y-m-d H:i:s",$value['createtime'])}></small></div>
						<div class="pa5h4"style=" height: 15px;">音乐名 ：<{$value['title']}></div>
						<div class="anniu">
							<font color="#fff">
								<b><a data-tid="mc_<{$value['id']}>"  url="<{$value['url']}>" href="javascript:void(0)" style="color:#ffffff" onclick="insertion_mc(this)">选定</a></b>
							</font>
						</div>
						<div class="anniu">
							<font color="#fff">
								<b>
									<b><a  href="javascript:void(0)" style="color:#ffffff" onclick="delete_ad(this)">取消</a></b>
								</b>
							</font>
						</div>
					</div>
					<hr class="hrrr"/>
				</foreach>
				<div id="loadding"></div>
			<div style="height:50px"></div>
			</div>
		</div>
	</div>
	<input type="hidden" id="page" value="1">
<script>
	function delete_ad(obj){
		$(obj).parents('#page4').remove();
	}
	
</script>

<script>
$(function(){
	$("#page4").scroll(function () {
		if($(this).scrollTop()>=($(".main6").height()-$(this).height())){		
			ajax_article();
		}
	});
});

//加载文章
function ajax_article(){
	var page = $('#page').val();
	if(page == '-1'){
		return false;
	}
	
	//加载进度条
	layer.open({
		type: 2,
		content: '加载中'
	});
	
	$.ajax({
		type: "POST",
		url: "<{:U('Home/Template/ajax_music_page')}>",
		data: "page="+page,
		dataType:'json',
		success: function(msg){
			if(msg.status == '1'){
				var html = '';
				for(var i  in  msg.data){
					html +='<div class="txt1pa2">';
					html +='<div class="pa5anr"><small  class="smallone">'+msg.data[i].createtime+'</small></div>';
					html +='<div class="pa5h4"style=" height: 15px;">音乐名 ：'+msg.data[i].title+'</div>';
					html +='<div class="anniu">';
					html +='<font color="#fff">';
					html +='<b><a data-tid="'+msg.data[i].id+'" url="'+msg.data[i].url+'" href="javascript:void(0)" style="color:#ffffff" onclick="insertion_mc(this)">选定</a></b>';
					html +='</font></div><div class="anniu"><font color="#fff"><b><b><a  href="javascript:void(0)" style="color:#ffffff" onclick="delete_ad(this)">取消</a></b></b></font></div></div><hr class="hrrr"/>';
				}
					
				page = parseInt(page) + 1;
				$('#page').val(page);
				$('#loadding').before(html);
				layer.closeAll();//关闭进度条
			}else{
				$('#page').val('-1');
				layer.closeAll(); //关闭进度条
			}
		}
	});
}
</script>